<?php
namespace App\Models;

/*
 * Mock travel destination data.
 * Note that we don't have to extend CodeIgniter's model for now
 */

class Dcmember {

    //mock data : an array of records
    protected $data = [
        '1' => [
            'id' => 1,
            'name' => 'batman',
            'description' => 'Batman, a superhero of American DC Comics, first appeared in the 27th issue of Detective Comics (May 1939), and was jointly created by Bob Kane and Bill Finger. Batman is the first superhero without super ability in comic history.',
            'link' => 'https://baike.so.com/doc/5372673-5608619.html',
            'height' => '180cm',
            'country' => 'USA',
            'gender' => 'boy',
            'image' => 'batman.jpg',
        ],
        '2' => [
            'id' => 2,
            'name' => 'theflash',
            'description' => '"The Flash", adapted from the DC cartoon of the same name, is a live-action superhero series produced by DC Entertainment and Warner in collaboration with CW TV Network, directed by David Nath and starring grant gustin, candice patton, Jesse Martin and tom cavanagh.',
            'link' => 'https://baike.so.com/doc/5622492-7755080.html',
            'height' => '180cm',
            'country' => 'USA',
            'gender' => 'boy',
            'image' => 'theflash.jpg',
        ],
        '3' => [
            'id' => 3,
            'name' => 'superman',
            'description' => 'Superman, a superhero under DC Comics Company, debuted in the first issue of Action Comics in June 1938, and was the first superhero in comic history.',
            'link' => 'https://baike.so.com/doc/735738-778902.html',
            'height' => '180cm',
            'country' => 'USA',
            'gender' => 'boy',
            'image' => 'superman.jpg',
        ],
        '4' => [
            'id' => 4,
            'name' => 'wonder woman',
            'description' => 'Wonder Woman is a fantastic action film produced by Warner Bros., directed by Patty Jenkins and starring Gal Gadot, chris pine, Connie Nielsen and robin wright.',
            'link' => 'https://baike.so.com/doc/34777-24837758.html',
            'height' => '180cm',
            'country' => 'USA',
            'gender' => 'gril',
            'image' => 'wonder woman.jpg',
        ],
        '5' => [
            'id' => 5,
            'name' => 'Aquaman',
            'description' => 'Aquaman is an action fantasy film produced by Warner Bros., directed by James Wan and starring Jason Momoa, Amber Heard and Patrick Wilson.',
            'link' => 'https://baike.so.com/doc/6635261-29996696.html',
            'height' => '180cm',
            'country' => 'USA',
            'gender' => 'boy',
            'image' => 'Aquaman.jpg',
        ],
        '6' => [
            'id' => 6,
            'name' => 'green lantern',
            'description' => 'The Green Lantern is directed by martin campbell, with michael goldenberg and michael green as screenwriters and Ryan Reynolds, Blake Lively, Peter Sarsgaard and mark strong as co-stars.',
            'link' => 'https://baike.so.com/doc/4928681-5148424.html',
            'height' => '180cm',
            'country' => 'USA',
            'gender' => 'boy',
            'image' => 'green lantern.jpg',
        ],
    ];

    public function findAll() {
        return $this->data;
    }

    public function find($id = null) {
        if (!empty($id) && isset($this->data[$id])) {
            return $this->data[$id];
        }
        return null;
    }

}
